<!DOCTYPE html>
<html>
<head>
    <script src="/resources/testharness.js"></script>
    <script src="/resources/testharnessreport.js"></script>
    <script>
        if (document.location.hostname == "127.0.0.1") {
            document.location.hostname = "subdomain.example.test";
        } else {
            test(function () {
                document.domain = 'example.test';

                var xhr = new XMLHttpRequest();
                xhr.open('POST', 'resources/post-echo.cgi', false);
                xhr.send('PASS');
                assert_equals(xhr.responseText, "PASS");
            }, "XMLHttpRequest allowed with document.domain set.");
        }
    </script>
</head>
<body>
</body>
</html>
